<div class="testimonials-container">
	<div class="container">
		<div class="row">
			<div class="col-sm-12 testimonials-title wow fadeIn">
				<h2>Testimonials</h2>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-10 col-sm-offset-1 testimonial-list">
				<div role="tabpanel">
					<!-- Tab panes -->
					<div class="tab-content">
                                            <?php $args = array(
							'posts_per_page'   => 4,
							'offset'           => 0,
							'category_name'    => 'testimonials',
							'orderby'          => 'post_date',
							'order'            => 'DESC',
							'post_type'        => 'post',
							'post_status'      => 'publish',
							'suppress_filters' => true
						);

						$posts = get_posts($args);

						foreach ($posts as $key => $post) : setup_postdata($post); ?>
							<?php $url = wp_get_attachment_url(get_post_thumbnail_id($post->ID));?>
                                            
                                                        <div role="tabpanel" class="tab-pane fade <?php echo $key == 0 ? 'in active': '';?>" id="tab<?php echo $key;?>">
                                                                <div class="testimonial-image">
                                                                        <img src="<?php echo $url;?>" alt="" data-at2x="<?php echo $url;?>">
                                                                </div>
                                                                <div class="testimonial-text">
                                                                        <p>
                                                                            <?php echo get_post_field('post_content', $post->ID); ?>
                                                                            <br>
                                                                            <a href="<?php echo get_permalink();?>"><?php echo get_the_title(); ?></a>
                                                                        </p>
                                                                </div>
                                                        </div>
						<?php endforeach;?>
					</div>
					<!-- Nav tabs -->
					<ul class="nav nav-tabs" role="tablist">
                                            <?php foreach ($posts as $key => $post):?>
						<li role="presentation" <?php echo $key == 0 ? 'class="active"': '';?>>
							<a href="#tab<?php echo $key; ?>" aria-controls="tab<?php echo $key; ?>" role="tab" data-toggle="tab"></a>
						</li>
                                            <?php endforeach;?>
                                            <?php wp_reset_postdata();?>
					</ul>
				</div>
			</div>
		</div>
	</div>
</div>